#ifndef BORDWIDGET_H_
#define BORDWIDGET_H_

#include <QWidget>
#include "../model/Board.h"
#include "LayoutManager.h"

class BordWidget : public QWidget
{
	enum HoverType
	{
		HoverTypeTile,
		HoverTypeCorner,
		HoverTypeSide,
		HoverTypeNothing,
	};

public:
	BordWidget(QWidget * parent = 0);
	virtual ~BordWidget();

protected:
	void paintEvent(QPaintEvent * event);
	void dragEnterEvent(QDragEnterEvent * event);
	void dropEvent(QDropEvent * event);
	void dragMoveEvent(QDragMoveEvent * event);
	void dragLeaveEvent(QDragLeaveEvent * event);
	void resizeEvent(QResizeEvent * event);

private:
	void acceptTile(QDropEvent * event);
	void recalculateMinimumSize();

	board::Board board;
	LayoutManager manager;

	bool bTileHoverActivated, bCornerHoverActivated, bSideHoverActivated;
	structure::HexVector hoverTile, hoverCorner, hoverSide;

	void setActiveHover(HoverType type, const structure::HexVector & position);
	HoverType getActiveHover() const;
	const structure::HexVector & getActiveHoverStructure() const;
};

#endif /* BORDWIDGET_H_ */
